package com.ly.heart.service.impl;

import java.util.Collections;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.common.utils.SecurityUtils;
import com.ly.common.utils.erp.SnowflakeIdWorker;
import com.ly.heart.domain.KingBaseBusinessGroupDetailEntity;
import com.ly.heart.domain.dto.KingBaseBusinessGroupQueryDto;
import com.ly.heart.domain.vo.KingBaseBusinessGroupVo;
import com.ly.heart.mapper.KingBaseBusinessGroupDetailMapper;
import com.ly.heart.service.IKingBaseBusinessGroupDetailService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/**
 * 金蝶-业务组类型明细Service业务层处理
 *
 * @author cxl
 * @date 2024-06-20
 */
@Service
public class KingBaseBusinessGroupDetailServiceImpl extends ServiceImpl<KingBaseBusinessGroupDetailMapper, KingBaseBusinessGroupDetailEntity> implements IKingBaseBusinessGroupDetailService {

    @Resource
    private KingBaseBusinessGroupDetailMapper kingBaseBusinessGroupDetailMapper;

    /**
     * 查询金蝶-业务组类型明细
     *
     * @param id 金蝶-业务组类型明细ID
     * @return 金蝶-业务组类型明细
     */
    @Override
    public KingBaseBusinessGroupDetailEntity selectKingBaseBusinessGroupDetailEntityById(String id)
    {
        return kingBaseBusinessGroupDetailMapper.selectKingBaseBusinessGroupDetailEntityById(id);
    }

    /**
     * 查询金蝶-业务组类型明细列表
     *
     * @param kingBaseBusinessGroupDetailEntity 金蝶-业务组类型明细
     * @return 金蝶-业务组类型明细
     */
    @Override
    public List<KingBaseBusinessGroupDetailEntity> selectKingBaseBusinessGroupDetailEntityList(KingBaseBusinessGroupDetailEntity kingBaseBusinessGroupDetailEntity)
    {
        return kingBaseBusinessGroupDetailMapper.selectKingBaseBusinessGroupDetailEntityList(kingBaseBusinessGroupDetailEntity);
    }

    /**
     * 新增金蝶-业务组类型明细
     *
     * @param kingBaseBusinessGroupDetailEntity 金蝶-业务组类型明细
     * @return 结果
     */
    @Override
    public int insertKingBaseBusinessGroupDetailEntity(KingBaseBusinessGroupDetailEntity kingBaseBusinessGroupDetailEntity)
    {
        kingBaseBusinessGroupDetailEntity.setCreateTime(DateUtils.getNowDate());
        kingBaseBusinessGroupDetailEntity.setId(SnowflakeIdWorker.getInstance().nextStringId());
        kingBaseBusinessGroupDetailEntity.setUserId(SecurityUtils.getLoginUser().getUser().getUserId());
        return kingBaseBusinessGroupDetailMapper.insertKingBaseBusinessGroupDetailEntity(kingBaseBusinessGroupDetailEntity);
    }

    /**
     * 修改金蝶-业务组类型明细
     *
     * @param kingBaseBusinessGroupDetailEntity 金蝶-业务组类型明细
     * @return 结果
     */
    @Override
    public int updateKingBaseBusinessGroupDetailEntity(KingBaseBusinessGroupDetailEntity kingBaseBusinessGroupDetailEntity)
    {
        kingBaseBusinessGroupDetailEntity.setChangeTime(DateUtils.getNowDate());
        return kingBaseBusinessGroupDetailMapper.updateKingBaseBusinessGroupDetailEntity(kingBaseBusinessGroupDetailEntity);
    }

    /**
     * 批量删除金蝶-业务组类型明细
     *
     * @param ids 需要删除的金蝶-业务组类型明细ID
     * @return 结果
     */
    @Override
    public int deleteKingBaseBusinessGroupDetailEntityByIds(String[] ids)
    {
        return kingBaseBusinessGroupDetailMapper.deleteKingBaseBusinessGroupDetailEntityByIds(ids);
    }

    /**
     * 删除金蝶-业务组类型明细信息
     *
     * @param id 金蝶-业务组类型明细ID
     * @return 结果
     */
    @Override
    public int deleteKingBaseBusinessGroupDetailEntityById(String id)
    {
        return kingBaseBusinessGroupDetailMapper.deleteKingBaseBusinessGroupDetailEntityById(id);
    }

    @Override
    public List<KingBaseBusinessGroupVo> getBusinessGroupDialog(KingBaseBusinessGroupQueryDto queryDto) {
        return kingBaseBusinessGroupDetailMapper.getBusinessGroupDialog(queryDto);
    }


}
